package com.by.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.by.entity.Product;
import com.by.service.ProductService;
import com.by.mapper.ProductMapper;
import com.by.vo.ProductDetailVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 16564
* @description 针对表【pms_product(商品表(SPU))】的数据库操作Service实现
* @createDate 2025-10-13 11:47:12
*/
@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product>
    implements ProductService{
    @Autowired
    private ProductMapper productMapper;


    @Override
    public ProductDetailVo getProductDetail(Long skuId) {
        return productMapper.selectProductDetail(skuId);
    }

    @Override
    public List<Product> listByCategoryId(Long catId) {
        List<Product> products = productMapper.listByCategoryId(catId);
        return products;
    }
}




